import request from '@/utils/request'

export const userRegisterService = ({ username, password, repassword }) =>
  request.post('/api/reg', { username, password, repassword })
export const userLoginService = ({ username, password }) =>
  request.post('/api/login', { username, password })
export const userGetInfoService = () => request.get('/my/userinfo')

export const userUploadAvatarService = (avatar) => request.patch('/my/update/avatar', { avatar })

export const userUpdatePasswordService = ({ old_pwd, new_pwd, re_pwd }) => {
  request.patch('/my/updatepwd', { old_pwd, new_pwd, re_pwd })
}
